<script setup lang="ts">
import useUserStore from '@/stores/user'
import { storeToRefs } from 'pinia'

const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore)
</script>

<template>
  <div class="">
    <section class="user-wrapper" v-if="userInfo">
      <el-avatar :src="userInfo.avatar"></el-avatar>
      <div class="welecome">欢迎回来！ {{ userInfo.name }}</div>
    </section>
  </div>
</template>

<style lang="scss" scoped>
.user-wrapper {
  width: 98%;
  display: flex;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--main-border-color);
  margin: 0 auto;
  .welecome {
    font-size: 20px;
    font-weight: 500;
    margin-left: 20px;
  }
}
</style>
